package com.mxl.common;

import java.math.BigDecimal;

public class SelectOptionUtil {
	// 后续考虑只显示比订单金额大的面额
	public static String setAmountList(String amounts, Long orderAmount) {
		String[] amount = amounts.split(",");
		orderAmount = new BigDecimal(orderAmount).divide(new BigDecimal(100))
				.longValue();
		StringBuilder amlist = new StringBuilder();
		for (String m : amount) {
			amlist.append(
					"<input name=\"selectAmount\" type=\"radio\" value=\"")
					.append(m + "00\"");
			if (Long.valueOf(m) < orderAmount.longValue()) {
				amlist.append(" disabled=\"disabled\"");
			}
			amlist.append("/>").append(m).append("元 &nbsp;&nbsp");
		}
		return amlist.toString();
	}
}
